Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Stabilize the thread_local_const_init feature #91355

Merged
merged 1 commit into from
Dec 5, 2021

Conversation

alexcrichton
Copy link
Member

This commit is intended to follow the stabilization disposition of the
FCP that has now finished in #84223. This stabilizes the ability to flag
thread local initializers as const expressions which enables the macro
to generate more efficient code for accessing it, notably removing
runtime checks for initialization.

More information can also be found in #84223 as well as the tests where
the feature usage was removed in this PR.

Closes #84223

This commit is intended to follow the stabilization disposition of the
FCP that has now finished in rust-lang#84223. This stabilizes the ability to flag
thread local initializers as `const` expressions which enables the macro
to generate more efficient code for accessing it, notably removing
runtime checks for initialization.

More information can also be found in rust-lang#84223 as well as the tests where
the feature usage was removed in this PR.

Closes rust-lang#84223
@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 29, 2021
@apiraino apiraino added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Dec 1, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Dec 4, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Dec 4, 2021

📌 Commit a0c9597 has been approved by m-ou-se

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 4, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 5, 2021
…askrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#89642 (environ on macos uses directly libc which has the correct signature.)
 - rust-lang#90022 (Explain why `Self` is invalid in generic parameters)
 - rust-lang#90023 (Postpone the evaluation of constant expressions that depend on inference variables)
 - rust-lang#91215 (Implement VecDeque::retain_mut)
 - rust-lang#91355 (std: Stabilize the `thread_local_const_init` feature)
 - rust-lang#91528 (LLVM support .insn directive)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 23012b5 into rust-lang:master Dec 5, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 5, 2021
@jplatte jplatte mentioned this pull request Dec 5, 2021
65 tasks
hrxi added a commit to hrxi/tracing that referenced this pull request Mar 18, 2022
Probably can't be included any time soon, as this requires Rust 1.59.

rust-lang/rust#91355 (comment)
hrxi added a commit to hrxi/tracing that referenced this pull request Mar 18, 2022
These don't require an initialization check on every access, which
should at least be useful for the `CURRENT_STATE` `thread_local!` in
`tracing-core`.

Probably can't be included any time soon, as this requires Rust 1.59:
rust-lang/rust#91355 (comment).
cuviper added a commit to cuviper/rayon that referenced this pull request Feb 27, 2023
This enables more efficient code -- stabilized in rust-lang/rust#91355.
bors bot added a commit to rayon-rs/rayon that referenced this pull request Feb 27, 2023
1027: Use const-TLS for the `WorkerThread` pointer (MSRV 1.59) r=cuviper a=cuviper

This enables more efficient code -- stabilized in rust-lang/rust#91355.


Co-authored-by: Josh Stone <cuviper@gmail.com>
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Apr 28, 2023
…d, r=thomcc

Document `const {}` syntax for `std::thread_local`.

It exists and is pretty cool. More people should use it.

It was added in rust-lang#83416 and stabilized in rust-lang#91355 with the tracking issue rust-lang#84223.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking Issue for const-initialized thread locals
7 participants